<%--
  Created by IntelliJ IDEA.
  User: Ice Bear
  Date: 2022/11/7
  Time: 10:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<% String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
//                          协议                         服务器命                          端口号                路径
%>
<%System.out.println("path: "+path);%>
<%System.out.println("basePath: "+basePath);%>
<base href="<%=basePath%>">
<a href="a.jsp">跳转到a.jsp</a><br>
<a href="b.jsp">跳转到b.jsp </a><br>

<br>
<a href="a/a.jsp">跳转到a/a.jsp</a><br>
<a href="a/b/b.jsp">跳转到a/b/a.jsp</a><br>
<a href="a/b/c.jsp">跳转到a/b/c.jsp</a><br>
</body>
</html>
